import request from '@/utils/myrequest'
// 初始化信息
function getList(kvs) {
  return request({
    url: '/mtms/ToolingPreLend/GetList',
    method: 'get',
    kvs
  })
}
// 扫描工单号,带出备件信息
function getPartsInfo(kvs) {
  return request({
    url: '/mtms/ToolingPreLend/GetInfoByWorkOrder',
    method: 'get',
    kvs
  })
}
// 有效性下拉
function getVailList(kvs) {
  return request({
    url: '/mtms/ToolingPreLend/GetStatusList',
    method: 'get',
    kvs
  })
}
// 点击生成表单
function createForm(kvs) {
  return request({
    url: '/mtms/ToolingPreLend/CreatePrelendForm',
    method: 'POST',
    kvs
  })
}
// 点击保存,保存预借单
function saveForm(kvs) {
  return request({
    url: '/mtms/ToolingPreLend/SavePrelendForm',
    method: 'POST',
    kvs
  })
}
// 删除
function doDelete(kvs) {
  return request({
    url: '/mtms/ToolingPreLend/Delete',
    method: 'POST',
    kvs
  })
}
// 借出->通过与预借单号,获取借用信息
function getLendInfo(kvs) {
  return request({
    url: '/mtms/ToolingPreLend/GetPrelendFrom',
    method: 'get',
    kvs
  })
}
// 借用保存
function doSaveLend(kvs) {
  return request({
    url: '/mtms/ToolingPreLend/LendTooling',
    method: 'POST',
    kvs
  })
}
// 验证备件编码
function checkBarcode(kvs) {
  return request({
    url: '/mtms/ToolingPreLend/CheckBarcode',
    method: 'POST',
    kvs
  })
}
export default {
  getPartsInfo, getList, getVailList, createForm, saveForm, doDelete,
  getLendInfo, doSaveLend, checkBarcode
}
